﻿import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Window 2.15
import YourComponents 1.0

Window {
    width: 800
    height: 600
    visible: true

    Column {
        anchors.fill: parent       

        VideoItem{
            id: videoDisplay
            width: parent.width
            height: parent.height - 50

            Connections {
                target: frameProvider
                function onNewFrameAvailable(frame) {
                    videoDisplay.updateFrame(frame)
                    frameProvider.frameProcessed()
                }
            }
        }

        Row {
            Button {
                text: "Play"
                onClicked: frameProvider.startVideo("E:/abc-120.mp4")
            }
            Button {
                text: "Stop"
                onClicked: frameProvider.stopVideo()
            }
        }
    }
}
